#ifndef CONTROL_H_
#define CONTROL_H_

#include "Element.h"
#include "pthread.h"

/**
 * \class Control
 * \brief a class structure which stores one instance of one data type and allows for two-way communication
 *
 * Controls are used in conjunction with ControlElements to perform complex or highly-customized actions within
 * modules.  Each Control offers a single input field and can be grouped infinitely within ControlElements.
 * A ControlElement, when clicked, updated the values of all its Controls to those input by the end-user.
 *
 * The class has no non-virtual methods and each daughter class redefines only those it uses.  Thus, an error message
 * is output if the Control is accessed incorrectly.
 *
 * All methods within StatusElement and it's derived classes are designed to be used internally.
 * If a module uses them, there is not provision to register these objects with ModuleHandler
 * and so the server cannot display them.
 */
class Control: public Element {
public:
	Control();
	virtual ~Control();

	virtual std::string getValueString();
	virtual long getValueInt();
	virtual double getValueDouble();
	virtual bool getValueBool();

	virtual void setValueString(std::string newStringValue);
	virtual void setValueInt(long newIntValue);
	virtual void setValueDouble(double newDoubleValue);
	virtual void setValueBool(bool newBoolValue);

	virtual void setValue(void* newValue) = 0;

private:
	/**
	 * \brief first piece of the error message
	 */
	std::string s1;
	/**
	 * \brief second piece of the error message
	 */
	std::string s2;
};

#endif /* CONTROL_H_ */
